﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Rabbit.Repository.Migrations
{
    public partial class log9 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "City",
                columns: table => new
                {
                    Cid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Pid = table.Column<int>(type: "int", nullable: false),
                    CName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_City", x => x.Cid);
                });

            migrationBuilder.CreateTable(
                name: "County",
                columns: table => new
                {
                    CXid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Cid = table.Column<int>(type: "int", nullable: false),
                    CXName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_County", x => x.CXid);
                });

            migrationBuilder.CreateTable(
                name: "Province",
                columns: table => new
                {
                    Pid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Province", x => x.Pid);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterImg",
                columns: table => new
                {
                    SImgid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SImgurl = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    TMid = table.Column<int>(type: "int", nullable: false),
                    SImgState = table.Column<int>(type: "int", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterImg", x => x.SImgid);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterInfo",
                columns: table => new
                {
                    SIid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TMid = table.Column<int>(type: "int", nullable: false),
                    TMBatch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SIWeigth = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    SIStaDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SIDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterInfo", x => x.SIid);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterQY",
                columns: table => new
                {
                    SQYid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TMid = table.Column<int>(type: "int", nullable: false),
                    SQYName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SQYDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Pid = table.Column<int>(type: "int", nullable: false),
                    Cid = table.Column<int>(type: "int", nullable: false),
                    CXid = table.Column<int>(type: "int", nullable: false),
                    SQYBrief = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterQY", x => x.SQYid);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "City");

            migrationBuilder.DropTable(
                name: "County");

            migrationBuilder.DropTable(
                name: "Province");

            migrationBuilder.DropTable(
                name: "SlaughterImg");

            migrationBuilder.DropTable(
                name: "SlaughterInfo");

            migrationBuilder.DropTable(
                name: "SlaughterQY");
        }
    }
}
